package com.lcxw.hxzbapi.service;

import com.lcxw.hxzbapi.entity.pojo.Attention;
import com.lcxw.hxzbapi.entity.pojo.YwpdMember;
import java.util.List;
import javax.annotation.Resource;

import com.lcxw.hxzbapi.entity.response.MemberResp;
import com.lcxw.hxzbapi.entity.response.Response;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import com.lcxw.hxzbapi.dao.mapper.AttentionMapper;

@Component
@Service
public class AttentionService {

    @Resource
    AttentionMapper attentionMapper;

    public List<Long> getAttentionUserbyUserId(long userId) {
        return attentionMapper.selectAttuidByUserId(userId);
    }

    public List<YwpdMember> getAtts(long userId) {
        return attentionMapper.getAtts(userId);
    }

    public List<Long> getAttentionRoombyUserId(long userId) {
        return attentionMapper.selectAttroomidByUserId(userId);
    }

    public int getCountOfAttuid(long attuid) throws Exception {
        return attentionMapper.selectCountOfAttuid(attuid);
    }

    public int addAttentionUser(long userId, long attuid, String attype, String addTime)
        throws Exception {
        return attentionMapper.addAttentionUser(userId, attuid, attype, addTime);
    }

    public int deleteAttentionUser(long userId, long attuid, String attype) throws Exception {
        return attentionMapper.deleteAttentionUser(userId, attuid, attype);
    }

    public Attention getAttentionByUserIdAndAttuId(long userId, long attuId, String attype) {
        return attentionMapper.getAttentionByUserIdAndAttuId(userId, attuId, attype);
    }
    public Attention getAttentionByUserIdStatus(long userId, long attuId, int status) {
        return attentionMapper.getAttentionByUserIdStatus(userId, attuId, status);
    }

    public int addOne(long userId, long attuId,String statusTime) {
        return attentionMapper.addOne(userId, attuId,statusTime);
    }

    public int descOne(long userId, long attuId) {
        return attentionMapper.descOne(userId, attuId);
    }

    public List<MemberResp> lists(long userId){
        return attentionMapper.lists(userId);
    }

    public List<Long> getFans(long attuId, String attype) {
        return attentionMapper.getFans(attuId, attype);
    }

    public List<YwpdMember> getFriends(long userId) {
        return attentionMapper.getFriends(userId);
    }

    public List<YwpdMember> getFans2(long userId) {
        return attentionMapper.getFans2(userId);
    }

    public int getFansNum(long attuId) {
        return attentionMapper.getFansNum(attuId);
    }

    public int getAttNum(long userId) {
        return attentionMapper.getAttNum(userId);
    }

    public int getFriendNum(long userId) {
        return attentionMapper.getFriendNum(userId);
    }


}
